<?php


  include "./phpthumb/ThumbLib.inc.php";
         //   exit();
			$mohu="001.png";
  
			$img_info = getimagesize($mohu);
		   
		    
            $width=$img_info['0'];
          
		  
			
			if($width<960){
			
				if($width<100){
					  
					  $beishu=1300;
					
					}elseif($width>100 and $width<300){
					
					  $beishu=1000; 
					 
					}elseif($width>300 and $width<600){
					
					  $beishu=400;
					
					}else{
					
					  $beishu=200;
					
					}
				 
				 
				 try {   
					  $thumb = PhpThumbFactory::create($mohu);
					  $thumb->resizePercent($beishu);
					  $thumb->resize(960);
					  $thumb->save('./images/002.png');
					} catch (Exception $e) {   
					print $e->getMessage();   
					exit();   
					}   
			}else{
			
			   $thumb = PhpThumbFactory::create($mohu);
			   $thumb->resize(960);
			   $thumb->save('./images/002.png');
			   
			   }